inherited frmDepotBill: TfrmDepotBill
  Left = 257
  Top = 169
  Caption = #20986#20837#24211#21333
  Position = poDesigned
  PixelsPerInch = 96
  TextHeight = 12
  inherited pnlDBCtrl: TPanel
    inherited pnlThirdtrade: TPanel
      inherited lblTTtraderid: TcxLabel
        AnchorX = 78
      end
      inherited cxLabel1: TcxLabel
        Left = 216
        ExplicitLeft = 216
        AnchorX = 244
      end
      inherited lblTTBalanceid: TcxLabel
        Left = 381
        ExplicitLeft = 381
        AnchorX = 433
      end
    end
    inherited lblName: TcxLabel
      Style.IsFontAssigned = True
    end
    inherited DtlPageCtrl: TcxPageControl
      inherited tabMain: TcxTabSheet
        inherited DtlGrid: TcxGrid
          Hint = #28857#20987#31354#34892#25110#31354#30333#22788#26032#22686#35760#24405#25110#36873#25321#21333#25454
          inherited DtlGridDBTableView: TcxGridDBBandedTableView
            OnCellDblClick = DtlGridDBTableViewCellDblClick
            OptionsView.NoDataToDisplayInfoText = #28857#20987#31354#34892#25110#31354#30333#22788#26032#22686#35760#24405#25110#36873#25321#21333#25454
          end
        end
      end
    end
    inherited lblPrinted: TcxLabel
      Style.IsFontAssigned = True
    end
    inherited dynlblCreate_by: TcxLabel
      AnchorX = 221
    end
    inherited dynlblCheck_by: TcxLabel
      AnchorX = 429
    end
    inherited dynlblFilid: TcxLabel
      AnchorX = 88
    end
    inherited dynlblDeptid: TcxLabel
      AnchorX = 301
    end
    inherited dynlblEmpid: TcxLabel
      AnchorX = 505
    end
    inherited dynlblBKind: TcxLabel
      AnchorX = 149
    end
  end
  inherited Panel1: TPanel
    inherited labFuncName: TcxLabel
      Style.IsFontAssigned = True
    end
    inherited labFuncDesc: TcxLabel
      Style.IsFontAssigned = True
    end
  end
  inherited pnlBottom: TPanel
    inherited lblDepotQty: TcxLabel
      Style.IsFontAssigned = True
    end
  end
  inherited MainDataSource: TDataSource
    Left = 209
    Top = 181
  end
  inherited ActionList1: TActionList
    object actScansBill: TAction
      Caption = #25195#25551#21333#25454
      ImageIndex = 5
      ShortCut = 122
      OnExecute = actScansBillExecute
    end
  end
  inherited PopupMenu1: TPopupMenu
    Left = 356
    Top = 92
  end
  inherited pmExec: TPopupMenu
    Top = 69
    object muScansBill: TMenuItem [1]
      Action = actScansBill
    end
  end
  inherited cxStyleRepository1: TcxStyleRepository
    PixelsPerInch = 96
    inherited cxGridBandedTableViewStyleSheet1: TcxGridBandedTableViewStyleSheet
      BuiltIn = True
    end
  end
  inherited cdsMaster: TClientDataSet
    Left = 136
    Top = 181
    object cdsMasterbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsMasterbkind: TIntegerField
      FieldName = 'bkind'
    end
    object cdsMasterbstate: TIntegerField
      FieldName = 'bstate'
    end
    object cdsMasterbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object cdsMasterbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object cdsMasterbtype: TIntegerField
      FieldName = 'btype'
    end
    object cdsMasterdepotid: TIntegerField
      FieldName = 'depotid'
    end
    object cdsMasterfilid: TIntegerField
      FieldName = 'filid'
    end
    object cdsMastertraderid: TIntegerField
      FieldName = 'traderid'
    end
    object cdsMasterempid: TIntegerField
      FieldName = 'empid'
    end
    object cdsMastercreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object cdsMastercheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object cdsMasterdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object cdsMastervoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object cdsMasterrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsMasteramount: TFloatField
      FieldName = 'amount'
    end
    object cdsMastertargetaddr: TStringField
      FieldName = 'targetaddr'
      Size = 200
    end
    object cdsMastercustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsMastercustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsMastercustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsMastercustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsMastercustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsMastercustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsMastercustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsMastercustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsMastercustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsMastercustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsMasterupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object cdsMasterremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object cdsMasterisauto: TBooleanField
      FieldName = 'isauto'
    end
    object cdsMastercreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object cdsMastercheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object cdsMastercustom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsMastercustom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsMastercustom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsMastercustom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsMastercustom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsMastertransitid: TIntegerField
      FieldName = 'transitid'
    end
    object cdsMastermachineid: TIntegerField
      FieldName = 'machineid'
    end
    object cdsMastertransporttype: TIntegerField
      FieldName = 'transporttype'
    end
    object cdsMastercontacter: TStringField
      FieldName = 'contacter'
      Size = 60
    end
    object cdsMastercontactphone: TStringField
      FieldName = 'contactphone'
      Size = 40
    end
    object cdsMastercontactfax: TStringField
      FieldName = 'contactfax'
      Size = 40
    end
    object cdsMasterscamt: TFloatField
      FieldName = 'scamt'
    end
    object cdsMasteriscash: TBooleanField
      FieldName = 'iscash'
    end
    object cdsMastert_code: TWideStringField
      FieldName = 't_code'
      Size = 50
    end
    object cdsMastert_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object cdsMasterdepotname: TWideStringField
      FieldName = 'depotname'
      Size = 60
    end
    object cdsMasterdepotcode: TStringField
      FieldName = 'depotcode'
      Size = 40
    end
    object cdsMasterprojectid: TIntegerField
      FieldName = 'projectid'
    end
    object cdsMasterpjcode: TWideStringField
      FieldName = 'pjcode'
      Size = 40
    end
    object cdsMasterpjname: TWideStringField
      FieldName = 'pjname'
      Size = 60
    end
  end
  inherited dspDetail: TDataSetProvider
    Top = 269
  end
  inherited cdsDetail: TClientDataSet
    object cdsDetailbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsDetailbno: TIntegerField
      FieldName = 'bno'
    end
    object cdsDetailborderno: TIntegerField
      FieldName = 'borderno'
    end
    object cdsDetailproductid: TIntegerField
      FieldName = 'productid'
    end
    object cdsDetailcprice: TFloatField
      FieldName = 'cprice'
    end
    object cdsDetailbprice: TFloatField
      FieldName = 'bprice'
    end
    object cdsDetailbquantity: TFloatField
      FieldName = 'bquantity'
    end
    object cdsDetaildisc: TFloatField
      FieldName = 'disc'
    end
    object cdsDetailtaxrate: TFloatField
      FieldName = 'taxrate'
    end
    object cdsDetailamount: TFloatField
      FieldName = 'amount'
    end
    object cdsDetailtaxamt: TFloatField
      FieldName = 'taxamt'
    end
    object cdsDetailproductamt: TFloatField
      FieldName = 'productamt'
    end
    object cdsDetailunitid: TIntegerField
      FieldName = 'unitid'
    end
    object cdsDetailquantity: TFloatField
      FieldName = 'quantity'
    end
    object cdsDetailprice: TFloatField
      FieldName = 'price'
    end
    object cdsDetailunit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object cdsDetailunit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object cdsDetailunit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object cdsDetailassqty: TFloatField
      FieldName = 'assqty'
    end
    object cdsDetailrelationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object cdsDetailbatchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object cdsDetailproductdate: TDateTimeField
      FieldName = 'productdate'
    end
    object cdsDetailvaliddate: TDateTimeField
      FieldName = 'validdate'
    end
    object cdsDetailrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object cdsDetailrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsDetailrelationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object cdsDetailrelationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object cdsDetailrelationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object cdsDetailrelationqty: TFloatField
      FieldName = 'relationqty'
    end
    object cdsDetailsaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 60
    end
    object cdsDetailioqty: TFloatField
      FieldName = 'ioqty'
    end
    object cdsDetailcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsDetailcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsDetailcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsDetailcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsDetailcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsDetailcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsDetailcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsDetailcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsDetailcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsDetailcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsDetailexplan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object cdsDetailpresent: TBooleanField
      FieldName = 'present'
    end
    object cdsDetailcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object cdsDetailcustom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsDetailcustom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsDetailcustom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsDetailcustom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsDetailcustom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsDetaillength: TFloatField
      FieldName = 'length'
    end
    object cdsDetailwidth: TFloatField
      FieldName = 'width'
    end
    object cdsDetailheight: TFloatField
      FieldName = 'height'
    end
    object cdsDetailsquare: TFloatField
      FieldName = 'square'
    end
    object cdsDetailcubage: TFloatField
      FieldName = 'cubage'
    end
    object cdsDetailspecificweight: TFloatField
      FieldName = 'specificweight'
    end
    object cdsDetailcustom16: TFloatField
      FieldName = 'custom16'
    end
    object cdsDetailcustom17: TFloatField
      FieldName = 'custom17'
    end
    object cdsDetailcustom18: TFloatField
      FieldName = 'custom18'
    end
    object cdsDetailcustom19: TFloatField
      FieldName = 'custom19'
    end
    object cdsDetailcustom20: TFloatField
      FieldName = 'custom20'
    end
    object cdsDetailAllqty: TStringField
      FieldName = 'Allqty'
      Size = 30
    end
    object cdsDetailrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 30
    end
    object cdsDetaildiscamt: TFloatField
      FieldName = 'discamt'
    end
    object cdsDetailalllay: TStringField
      FieldName = 'alllay'
      Size = 300
    end
    object cdsDetailp_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object cdsDetailp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object cdsDetailp_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object cdsDetailp_abname: TWideStringField
      FieldName = 'p_abname'
      Size = 60
    end
    object cdsDetailp_custom1: TStringField
      FieldName = 'p_custom1'
      Size = 100
    end
    object cdsDetailp_custom2: TStringField
      FieldName = 'p_custom2'
      Size = 100
    end
    object cdsDetailp_custom3: TStringField
      FieldName = 'p_custom3'
      Size = 100
    end
    object cdsDetailp_custom4: TStringField
      FieldName = 'p_custom4'
      Size = 100
    end
    object cdsDetailp_custom5: TStringField
      FieldName = 'p_custom5'
      Size = 100
    end
    object cdsDetailp_custom6: TStringField
      FieldName = 'p_custom6'
      Size = 100
    end
    object cdsDetailp_custom7: TStringField
      FieldName = 'p_custom7'
      Size = 100
    end
    object cdsDetailp_custom8: TStringField
      FieldName = 'p_custom8'
      Size = 100
    end
    object cdsDetailp_custom9: TStringField
      FieldName = 'p_custom9'
      Size = 100
    end
    object cdsDetailp_custom10: TStringField
      FieldName = 'p_custom10'
      Size = 100
    end
    object cdsDetailproducttypename: TWideStringField
      FieldName = 'producttypename'
      Size = 60
    end
    object cdsDetailproducttypeid: TIntegerField
      FieldName = 'producttypeid'
    end
    object cdsDetailbarcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object cdsDetailunitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object cdsDetailunitrate: TFloatField
      FieldName = 'unitrate'
    end
    object cdsDetailbaseunitname: TWideStringField
      FieldName = 'baseunitname'
      Size = 40
    end
    object cdsDetailunitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object cdsDetailproductpic: TBlobField
      FieldName = 'productpic'
    end
    object cdsDetailsalefittings: TBooleanField
      FieldName = 'salefittings'
    end
    object cdsDetailrelationbdtlno: TIntegerField
      FieldName = 'relationbdtlno'
    end
    object cdsDetailp_kind: TIntegerField
      FieldName = 'p_kind'
    end
    object cdsDetailp_calc: TByteField
      FieldName = 'p_calc'
    end
    object cdsDetailp_batch: TBooleanField
      FieldName = 'p_batch'
    end
  end
  inherited cdsGather: TClientDataSet
    Left = 488
    Top = 308
  end
  inherited dsGather: TDataSource
    Left = 492
    Top = 373
  end
  inherited qryDetail: TUniQuery
    SQL.Strings = (
      
        'select d.*,cast(dbo.f_getallqty(d.productid,unit1qty,unit2qty,un' +
        'it3qty) as varchar(30)) as Allqty '
      
        '     ,dbo.f_getrelationbcode(d.relationbtype,d.relationbid) as r' +
        'elationbcode'
      
        '     ,round((d.price*(1+d.taxrate/100)/(d.disc/100))*(1-d.disc/1' +
        '00)*d.quantity,2) as discamt'
      
        '     ,cast(dbo.f_getalllay(d.bid,d.bno) as varchar(300)) as alll' +
        'ay'
      
        '     ,p.code p_code, p.name p_name, p.spec p_spec, p.abname p_ab' +
        'name'
      
        '     ,p.custom1 p_custom1, p.custom2 p_custom2, p.custom3 p_cust' +
        'om3, p.custom4 p_custom4, p.custom5 p_custom5   '
      
        '     ,p.custom6 p_custom6, p.custom7 p_custom7, p.custom8 p_cust' +
        'om8, p.custom9 p_custom9, p.custom10 p_custom10 '
      '     ,pt.name as producttypename,p.producttypeid'
      '     ,u.barcode, u.unitname, u.rate unitrate '
      
        '     ,t.unitname as baseunitname,l.unitname as unitassname      ' +
        '                           '
      '     ,pic.pic as productpic'
      '     from tb_depotdtl d'
      '     left join td_product p on d.productid=p.p_id'
      '     left join td_producttype pt on p.producttypeid=pt.id'
      
        '     left join td_unitprice u on (d.productid=u.productid and d.' +
        'unitid=u.unitid)       '
      
        '     left join td_unitprice t on (d.productid=t.productid and t.' +
        'baseunit=1)            '
      
        '     left join td_unitprice l on (d.productid=l.productid and l.' +
        'u_no=0)                '
      
        '     left join td_productpic pic on d.productid=pic.productid an' +
        'd pic.defpic=1'
      '     where bid=0 order by d.borderno')
    Left = 236
    object qryDetailbid: TIntegerField
      FieldName = 'bid'
    end
    object qryDetailbno: TIntegerField
      FieldName = 'bno'
    end
    object qryDetailborderno: TIntegerField
      FieldName = 'borderno'
    end
    object qryDetailproductid: TIntegerField
      FieldName = 'productid'
    end
    object qryDetailcprice: TFloatField
      FieldName = 'cprice'
    end
    object qryDetailbprice: TFloatField
      FieldName = 'bprice'
    end
    object qryDetailbquantity: TFloatField
      FieldName = 'bquantity'
    end
    object qryDetaildisc: TFloatField
      FieldName = 'disc'
    end
    object qryDetailtaxrate: TFloatField
      FieldName = 'taxrate'
    end
    object qryDetailamount: TFloatField
      FieldName = 'amount'
    end
    object qryDetailtaxamt: TFloatField
      FieldName = 'taxamt'
    end
    object qryDetailproductamt: TFloatField
      FieldName = 'productamt'
    end
    object qryDetailunitid: TIntegerField
      FieldName = 'unitid'
    end
    object qryDetailquantity: TFloatField
      FieldName = 'quantity'
    end
    object qryDetailprice: TFloatField
      FieldName = 'price'
    end
    object qryDetailunit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object qryDetailunit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object qryDetailunit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object qryDetailassqty: TFloatField
      FieldName = 'assqty'
    end
    object qryDetailrelationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object qryDetailbatchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object qryDetailproductdate: TDateTimeField
      FieldName = 'productdate'
    end
    object qryDetailvaliddate: TDateTimeField
      FieldName = 'validdate'
    end
    object qryDetailrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object qryDetailrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object qryDetailrelationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object qryDetailrelationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object qryDetailrelationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object qryDetailrelationqty: TFloatField
      FieldName = 'relationqty'
    end
    object qryDetailsaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 60
    end
    object qryDetailioqty: TFloatField
      FieldName = 'ioqty'
    end
    object qryDetailcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object qryDetailcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object qryDetailcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object qryDetailcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object qryDetailcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object qryDetailcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object qryDetailcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object qryDetailcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object qryDetailcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object qryDetailcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object qryDetailexplan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object qryDetailpresent: TBooleanField
      FieldName = 'present'
    end
    object qryDetailcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object qryDetailcustom11: TFloatField
      FieldName = 'custom11'
    end
    object qryDetailcustom12: TFloatField
      FieldName = 'custom12'
    end
    object qryDetailcustom13: TFloatField
      FieldName = 'custom13'
    end
    object qryDetailcustom14: TFloatField
      FieldName = 'custom14'
    end
    object qryDetailcustom15: TFloatField
      FieldName = 'custom15'
    end
    object qryDetaillength: TFloatField
      FieldName = 'length'
    end
    object qryDetailwidth: TFloatField
      FieldName = 'width'
    end
    object qryDetailheight: TFloatField
      FieldName = 'height'
    end
    object qryDetailsquare: TFloatField
      FieldName = 'square'
    end
    object qryDetailcubage: TFloatField
      FieldName = 'cubage'
    end
    object qryDetailspecificweight: TFloatField
      FieldName = 'specificweight'
    end
    object qryDetailcustom16: TFloatField
      FieldName = 'custom16'
    end
    object qryDetailcustom17: TFloatField
      FieldName = 'custom17'
    end
    object qryDetailcustom18: TFloatField
      FieldName = 'custom18'
    end
    object qryDetailcustom19: TFloatField
      FieldName = 'custom19'
    end
    object qryDetailcustom20: TFloatField
      FieldName = 'custom20'
    end
    object qryDetailAllqty: TStringField
      FieldName = 'Allqty'
      Size = 30
    end
    object qryDetailrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 30
    end
    object qryDetaildiscamt: TFloatField
      FieldName = 'discamt'
    end
    object qryDetailalllay: TStringField
      FieldName = 'alllay'
      Size = 300
    end
    object qryDetailp_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object qryDetailp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object qryDetailp_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object qryDetailp_abname: TWideStringField
      FieldName = 'p_abname'
      Size = 60
    end
    object qryDetailp_custom1: TStringField
      FieldName = 'p_custom1'
      Size = 100
    end
    object qryDetailp_custom2: TStringField
      FieldName = 'p_custom2'
      Size = 100
    end
    object qryDetailp_custom3: TStringField
      FieldName = 'p_custom3'
      Size = 100
    end
    object qryDetailp_custom4: TStringField
      FieldName = 'p_custom4'
      Size = 100
    end
    object qryDetailp_custom5: TStringField
      FieldName = 'p_custom5'
      Size = 100
    end
    object qryDetailp_custom6: TStringField
      FieldName = 'p_custom6'
      Size = 100
    end
    object qryDetailp_custom7: TStringField
      FieldName = 'p_custom7'
      Size = 100
    end
    object qryDetailp_custom8: TStringField
      FieldName = 'p_custom8'
      Size = 100
    end
    object qryDetailp_custom9: TStringField
      FieldName = 'p_custom9'
      Size = 100
    end
    object qryDetailp_custom10: TStringField
      FieldName = 'p_custom10'
      Size = 100
    end
    object qryDetailproducttypename: TWideStringField
      FieldName = 'producttypename'
      Size = 60
    end
    object qryDetailproducttypeid: TIntegerField
      FieldName = 'producttypeid'
    end
    object qryDetailbarcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object qryDetailunitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object qryDetailunitrate: TFloatField
      FieldName = 'unitrate'
    end
    object qryDetailbaseunitname: TWideStringField
      FieldName = 'baseunitname'
      Size = 40
    end
    object qryDetailunitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object qryDetailproductpic: TBlobField
      FieldName = 'productpic'
    end
    object qryDetailrelationbdtlno: TIntegerField
      FieldName = 'relationbdtlno'
    end
    object qryDetailsalefittings: TBooleanField
      FieldName = 'salefittings'
    end
    object qryDetailp_kind: TIntegerField
      FieldName = 'p_kind'
    end
    object qryDetailp_calc: TByteField
      FieldName = 'p_calc'
    end
    object qryDetailp_batch: TBooleanField
      FieldName = 'p_batch'
    end
  end
  inherited MainDataSet: TUniQuery
    SQL.Strings = (
      'select top 1 m.*, t.scamt,t.iscash,t.code t_code,t.name t_name '
      '    ,d.name depotname, d.code depotcode '
      '     from tb_depot m '
      '     left join td_trader t on m.traderid=t.traderid'
      '     left join td_depot d on m.depotid=d.depotid'
      '     where 1=1')
    object MainDataSetbid: TIntegerField
      FieldName = 'bid'
    end
    object MainDataSetbkind: TIntegerField
      FieldName = 'bkind'
    end
    object MainDataSetbstate: TIntegerField
      FieldName = 'bstate'
    end
    object MainDataSetbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object MainDataSetbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object MainDataSetbtype: TIntegerField
      FieldName = 'btype'
    end
    object MainDataSetdepotid: TIntegerField
      FieldName = 'depotid'
    end
    object MainDataSetfilid: TIntegerField
      FieldName = 'filid'
    end
    object MainDataSettraderid: TIntegerField
      FieldName = 'traderid'
    end
    object MainDataSetempid: TIntegerField
      FieldName = 'empid'
    end
    object MainDataSetcreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object MainDataSetcheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object MainDataSetdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object MainDataSetvoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object MainDataSetrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object MainDataSetamount: TFloatField
      FieldName = 'amount'
    end
    object MainDataSettargetaddr: TStringField
      FieldName = 'targetaddr'
      Size = 200
    end
    object MainDataSetcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object MainDataSetcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object MainDataSetcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object MainDataSetcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object MainDataSetcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object MainDataSetcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object MainDataSetcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object MainDataSetcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object MainDataSetcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object MainDataSetcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object MainDataSetupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object MainDataSetremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object MainDataSetisauto: TBooleanField
      FieldName = 'isauto'
    end
    object MainDataSetcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object MainDataSetcheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object MainDataSetcustom11: TFloatField
      FieldName = 'custom11'
    end
    object MainDataSetcustom12: TFloatField
      FieldName = 'custom12'
    end
    object MainDataSetcustom13: TFloatField
      FieldName = 'custom13'
    end
    object MainDataSetcustom14: TFloatField
      FieldName = 'custom14'
    end
    object MainDataSetcustom15: TFloatField
      FieldName = 'custom15'
    end
    object MainDataSettransitid: TIntegerField
      FieldName = 'transitid'
    end
    object MainDataSetmachineid: TIntegerField
      FieldName = 'machineid'
    end
    object MainDataSettransporttype: TIntegerField
      FieldName = 'transporttype'
    end
    object MainDataSetcontacter: TStringField
      FieldName = 'contacter'
      Size = 60
    end
    object MainDataSetcontactphone: TStringField
      FieldName = 'contactphone'
      Size = 40
    end
    object MainDataSetcontactfax: TStringField
      FieldName = 'contactfax'
      Size = 40
    end
    object MainDataSetscamt: TFloatField
      FieldName = 'scamt'
    end
    object MainDataSetiscash: TBooleanField
      FieldName = 'iscash'
    end
    object MainDataSett_code: TWideStringField
      FieldName = 't_code'
      Size = 50
    end
    object MainDataSett_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object MainDataSetdepotname: TWideStringField
      FieldName = 'depotname'
      Size = 60
    end
    object MainDataSetdepotcode: TStringField
      FieldName = 'depotcode'
      Size = 40
    end
    object MainDataSetprojectid: TIntegerField
      FieldName = 'projectid'
    end
    object MainDataSetpjcode: TWideStringField
      FieldName = 'pjcode'
      Size = 40
    end
    object MainDataSetpjname: TWideStringField
      FieldName = 'pjname'
      Size = 60
    end
  end
  object qryDepotLay: TUniQuery [36]
    SQLInsert.Strings = (
      'Insert into TB_DEPOTLAY(bid,'
      'bno,'
      'layid,'
      'bquantity,'
      'quantity,'
      'unit1qty,'
      'unit2qty,'
      'unit3qty,'
      'assqty,'
      'create_time'
      ')'
      'Values'
      '(:bid,'
      ':bno,'
      ':layid,'
      ':bquantity,'
      ':quantity,'
      ':unit1qty,'
      ':unit2qty,'
      ':unit3qty,'
      ':assqty,'
      ':create_time)')
    SQLDelete.Strings = (
      
        'Delete from TB_DEPOTLAY where bid=:OLD_bid and bno=:OLD_bno and ' +
        'layid=:OLD_layid')
    SQLUpdate.Strings = (
      'Update TB_DEPOTLAY set '
      'bid=:bid,'
      'bno=:bno,'
      'layid=:layid,'
      'bquantity=:bquantity,'
      'quantity=:quantity,'
      'unit1qty=:unit1qty,'
      'unit2qty=:unit2qty,'
      'unit3qty=:unit3qty,'
      'assqty=:assqty,'
      'create_time=:create_time'
      ' where bid=:OLD_bid and bno=:OLD_bno and layid=:OLD_layid')
    SQL.Strings = (
      
        'select d.*,l.Name,l.Code from tb_depotlay d left join td_lay l o' +
        'n d.layid=l.id')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 228
    Top = 345
    object qryDepotLaybid: TIntegerField
      FieldName = 'bid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qryDepotLaybno: TIntegerField
      FieldName = 'bno'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qryDepotLaylayid: TIntegerField
      FieldName = 'layid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qryDepotLaybquantity: TFloatField
      FieldName = 'bquantity'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotLayquantity: TFloatField
      FieldName = 'quantity'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotLayunit1qty: TFloatField
      FieldName = 'unit1qty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotLayunit2qty: TFloatField
      FieldName = 'unit2qty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotLayunit3qty: TFloatField
      FieldName = 'unit3qty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotLayassqty: TFloatField
      FieldName = 'assqty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotLaycreate_time: TDateTimeField
      FieldName = 'create_time'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotLayName: TStringField
      DisplayWidth = 60
      FieldName = 'Name'
      ProviderFlags = []
      Size = 60
    end
    object qryDepotLayCode: TStringField
      FieldName = 'Code'
      ProviderFlags = []
      Size = 32
    end
  end
  object qryDepotBat: TUniQuery [37]
    SQLInsert.Strings = (
      'Insert into TB_DEPOTBAT(bid,'
      'bno,'
      'batchcode,'
      'bquantity,'
      'unitid,'
      'quantity,'
      'unit1qty,'
      'unit2qty,'
      'unit3qty,'
      'assqty,'
      'productdate,'
      'validdate,'
      'create_time'
      ')'
      'Values'
      '(:bid,'
      ':bno,'
      ':batchcode,'
      ':bquantity,'
      ':unitid,'
      ':quantity,'
      ':unit1qty,'
      ':unit2qty,'
      ':unit3qty,'
      ':assqty,'
      ':productdate,'
      ':validdate,'
      ':create_time)')
    SQLDelete.Strings = (
      
        'Delete from TB_DEPOTBAT where bid=:OLD_bid and bno=:OLD_bno and ' +
        'batchcode=:OLD_batchcode')
    SQLUpdate.Strings = (
      'Update TB_DEPOTBAT set '
      'bid=:bid,'
      'bno=:bno,'
      'batchcode=:batchcode,'
      'bquantity=:bquantity,'
      'unitid=:unitid,'
      'quantity=:quantity,'
      'unit1qty=:unit1qty,'
      'unit2qty=:unit2qty,'
      'unit3qty=:unit3qty,'
      'assqty=:assqty,'
      'productdate=:productdate,'
      'validdate=:validdate,'
      'create_time=:create_time'
      
        ' where bid=:OLD_bid and bno=:OLD_bno and batchcode=:OLD_batchcod' +
        'e')
    SQL.Strings = (
      'select * from tb_depotbat')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 212
    Top = 405
    object qryDepotBatbid: TIntegerField
      FieldName = 'bid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qryDepotBatbno: TIntegerField
      FieldName = 'bno'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qryDepotBatbatchcode: TStringField
      FieldName = 'batchcode'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Size = 200
    end
    object qryDepotBatbquantity: TFloatField
      FieldName = 'bquantity'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatunitid: TIntegerField
      FieldName = 'unitid'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatquantity: TFloatField
      FieldName = 'quantity'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatunit1qty: TFloatField
      FieldName = 'unit1qty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatunit2qty: TFloatField
      FieldName = 'unit2qty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatunit3qty: TFloatField
      FieldName = 'unit3qty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatassqty: TFloatField
      FieldName = 'assqty'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatproductdate: TDateTimeField
      FieldName = 'productdate'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatvaliddate: TDateTimeField
      FieldName = 'validdate'
      ProviderFlags = [pfInUpdate]
    end
    object qryDepotBatcreate_time: TDateTimeField
      FieldName = 'create_time'
      ProviderFlags = [pfInUpdate]
    end
  end
  object cdsDepotLay: TClientDataSet [38]
    Aggregates = <>
    Params = <>
    ProviderName = 'dspDepotLay'
    AfterPost = cdsDepotLayAfterPost
    OnNewRecord = cdsDepotBatNewRecord
    Left = 332
    Top = 343
    object cdsDepotLaybid: TIntegerField
      FieldName = 'bid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object cdsDepotLaybno: TIntegerField
      FieldName = 'bno'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object cdsDepotLaylayid: TIntegerField
      DisplayLabel = #36135#20301
      FieldName = 'layid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
      OnChange = cdsDepotLaylayidChange
    end
    object cdsDepotLaybquantity: TFloatField
      DisplayLabel = #22522#26412#21333#20301#25968#37327
      FieldName = 'bquantity'
      ProviderFlags = [pfInUpdate]
    end
    object cdsDepotLayquantity: TFloatField
      DisplayLabel = #25968#37327
      FieldName = 'quantity'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotLayunit1qtyChange
    end
    object cdsDepotLayunit1qty: TFloatField
      DisplayLabel = #21333#20301'1'#25968#37327
      FieldName = 'unit1qty'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotLayunit1qtyChange
    end
    object cdsDepotLayunit2qty: TFloatField
      DisplayLabel = #21333#20301'2'#25968#37327
      FieldName = 'unit2qty'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotLayunit1qtyChange
    end
    object cdsDepotLayunit3qty: TFloatField
      DisplayLabel = #21333#20301'3'#25968#37327
      FieldName = 'unit3qty'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotLayunit1qtyChange
    end
    object cdsDepotLayassqty: TFloatField
      DisplayLabel = #36741#21161#21333#20301#25968#37327
      FieldName = 'assqty'
      ProviderFlags = [pfInUpdate]
    end
    object cdsDepotLaycreate_time: TDateTimeField
      FieldName = 'create_time'
      ProviderFlags = [pfInUpdate]
    end
    object cdsDepotLayName: TStringField
      DisplayLabel = #36135#20301#21517#31216
      FieldName = 'Name'
      ProviderFlags = []
      Size = 60
    end
    object cdsDepotLayCode: TStringField
      DisplayLabel = #36135#20301#32534#30721
      FieldName = 'Code'
      ProviderFlags = []
      Size = 32
    end
  end
  object dsDepotLay: TDataSource [39]
    DataSet = cdsDepotLay
    Left = 396
    Top = 355
  end
  object dspDepotLay: TDataSetProvider [40]
    DataSet = qryDepotLay
    UpdateMode = upWhereKeyOnly
    Left = 284
    Top = 355
  end
  object dspDepotBat: TDataSetProvider [41]
    DataSet = qryDepotBat
    UpdateMode = upWhereKeyOnly
    Left = 264
    Top = 421
  end
  object cdsDepotBat: TClientDataSet [42]
    Aggregates = <>
    Params = <>
    ProviderName = 'dspDepotBat'
    AfterPost = cdsDepotBatAfterPost
    OnNewRecord = cdsDepotBatNewRecord
    Left = 328
    Top = 405
    object cdsDepotBatbid: TIntegerField
      FieldName = 'bid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object cdsDepotBatbno: TIntegerField
      FieldName = 'bno'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object cdsDepotBatbatchcode: TStringField
      DisplayLabel = #25209#21495
      FieldName = 'batchcode'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Size = 200
    end
    object cdsDepotBatbquantity: TFloatField
      DisplayLabel = #22522#26412#21333#20301#25968#37327
      FieldName = 'bquantity'
      ProviderFlags = [pfInUpdate]
    end
    object cdsDepotBatunitid: TIntegerField
      FieldName = 'unitid'
      ProviderFlags = [pfInUpdate]
    end
    object cdsDepotBatquantity: TFloatField
      DisplayLabel = #25968#37327
      FieldName = 'quantity'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotBatunit1qtyChange
    end
    object cdsDepotBatunit1qty: TFloatField
      DisplayLabel = #21333#20301'1'#25968#37327
      FieldName = 'unit1qty'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotBatunit1qtyChange
    end
    object cdsDepotBatunit2qty: TFloatField
      DisplayLabel = #21333#20301'2'#25968#37327
      FieldName = 'unit2qty'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotBatunit1qtyChange
    end
    object cdsDepotBatunit3qty: TFloatField
      DisplayLabel = #21333#20301'3'#25968#37327
      FieldName = 'unit3qty'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotBatunit1qtyChange
    end
    object cdsDepotBatassqty: TFloatField
      DisplayLabel = #36741#21161#21333#20301#25968#37327
      FieldName = 'assqty'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotBatassqtyChange
    end
    object cdsDepotBatproductdate: TDateTimeField
      DisplayLabel = #29983#20135#26085#26399
      FieldName = 'productdate'
      ProviderFlags = [pfInUpdate]
      OnChange = cdsDepotBatunit1qtyChange
    end
    object cdsDepotBatvaliddate: TDateTimeField
      DisplayLabel = #26377#25928#26399
      FieldName = 'validdate'
      ProviderFlags = [pfInUpdate]
    end
    object cdsDepotBatcreate_time: TDateTimeField
      FieldName = 'create_time'
      ProviderFlags = [pfInUpdate]
    end
  end
  object dsDepotBat: TDataSource [43]
    DataSet = cdsDepotBat
    Left = 384
    Top = 417
  end
  inherited dsThirdtrade: TDataSource
    Left = 276
    Top = 465
  end
  object qryPack: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select * from tb_depotpack')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    OnNewRecord = qryPackNewRecord
    Left = 352
    Top = 171
  end
end
